package com.addcn.texas.view.components
{	
	import flash.display.*;
	import flash.events.*;
	
	import com.addcn.common.event.ParamEvent;
	
	public class LeftModuleUi extends MovieClip	
	{
		public static const  EVENT :String = "regEvent";
		
		function LeftModuleUi() {
			addRegButton() ;		  
			this.introBtn.addEventListener(MouseEvent.CLICK,introBtnClickHandler);
			this.rechargeBtn.addEventListener(MouseEvent.CLICK,rechargeBtnClickHandler);
			this.toWebSite.addEventListener(MouseEvent.CLICK, toWebSiteClickHandler);	
		}		
		
		function addRegButton() {
				var register_btn :register = new register();
				this.addChild(register_btn);
				register_btn.x = 7.7;
				register_btn.y = 205;
				register_btn.addEventListener(MouseEvent.CLICK, register_btnClickHandler);		
		}
		private function register_btnClickHandler(evt:Event) {
				var event : ParamEvent = new ParamEvent(LeftModuleUi.EVENT, { type:"reg" } );
				this.dispatchEvent(event);
		}
		
		private function introBtnClickHandler(evt:Event) {
			  var event : ParamEvent = new ParamEvent(LeftModuleUi.EVENT,{type:"intro"});
				this.dispatchEvent(event);				
		}
		
		private function rechargeBtnClickHandler(evt:Event) {
				var event : ParamEvent = new ParamEvent(LeftModuleUi.EVENT,{type:"recharge"});
				this.dispatchEvent(event);
		}
 
		private function toWebSiteClickHandler(evt:Event) {		
			var event : ParamEvent = new ParamEvent(LeftModuleUi.EVENT,{type:"webSite"});
				this.dispatchEvent(event);
		}		
				
	}
}
